package com.happly.happlycloud.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.happly.happlycloud.common.ServerResponse;
import com.happly.happlycloud.dao.PaperMapper;
import com.happly.happlycloud.pojo.Paper;
import com.happly.happlycloud.service.IPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

;

@Service("iPaperService")
public class PaperServiceImpl implements IPaperService {

    @Autowired
    private PaperMapper paperMapper;


    @Override
    public ServerResponse<PageInfo> findGrade(String username, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Paper> list=paperMapper.findGrade(username);
        PageInfo pageResult = new PageInfo(list);
        pageResult.setList(list);
        return ServerResponse.createBySuccess(pageResult);
    }

}
